package com.sky.controller.user;

import com.sky.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController("UserShopController")//避免冲突在这里声明bean的名称
@RequestMapping("/user/shop")
@Slf4j
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    //1表示营业 0表示停页


    @GetMapping("/status")
    public Result<Integer> getStatus(){
        return Result.success((Integer)redisTemplate.opsForValue().get("SHOP_STATUS"));
    }

}
